import { _get, _post, _delete } from './index';

// 获取职位列表
export const getPositionList = (data) => {
    const req = {
      data,
      url: '/api/position/list',
    };
    return _post(req);
};

// 获取职位列表
export const getjobFairList = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/jobfair/list',
  };
  return _post(req);
};

// 获取职位详情
export const getPositionDetail = (data) => {
  console.log(data)
  const req = {
    data: {},
    url: '/api/position/'+ data.id,
  };
  return _get(req);
};


// 获取招聘会详情
export const getJobfairDetail = (data) => {
  console.log(data)
  const req = {
    data: {},
    url: '/api/jobfair/'+ data.id,
  };
  return _get(req);
};

// 获取公司详情
export const getCompanyDetail = (data) => {
  console.log(data)
  const req = {
    data: {},
    url: '/api/company/'+ data.id,
  };
  return _get(req);
};

// 获取参会企业列表
export const getJobFairAppliedList = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/jobfairapplied/list',
  };
  return _post(req);
};

// 投递简历
export const resumePosted = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/resumePosted/save',
  };
  return _post(req);
};

// 企业是否参会
export const jobFairAppliedIsApplied = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/jobfairapplied/isApplied',
  };
  return _post(req);
};

// 企业报名
export const jobFairAppliedSave = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/jobfairapplied/save',
  };
  return _post(req);
};

// 新增职位
export const handleAddPosition = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/position/save',
  };
  return _post(req);
};

// 删除职位
export const handleSureRemovePosition = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/position/remove',
  };
  return _post(req);
};

// 编辑职位
export const handleExitPosition = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/position/update',
  };
  return _post(req);
};

// 获取已投递职位
export const handlelistForUser = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/resumePosted/listForUser',
  };
  return _post(req);
};

// 企业查看已投递简历
export const handlelistForCompany = (data) => {
  console.log(data)
  const req = {
    data,
    url: '/api/resumePosted/listForCompany',
  };
  return _post(req);
};

